#ifndef BASE_MATHS_H
#define BASE_MATHS_H

#include "base_core.h"

int i_clamp(int val, int min, int max);


//-----------------------------------------------------------------------------
// Vector
//-----------------------------------------------------------------------------


typedef float vec2[2];

/**
 * \brief Compute the dot product of two vectors.
 * \param u First vector.
 * \param v Second vector.
 * \return The dot product.
 */

float vec2_dot(vec2 u, vec2 v);

/**
 * \brief Compute the length of a vector.
 * \param u First vector.
 * \param v Second vector.
 * \return The dot product.
 */
float vec2_length(vec2 u);

/**
 * \brief Substract two vectors.
 * \param dest Result vector.
 * \param u First vector.
 * \param v Second vector.
 */
void vec2_sub(vec2 dest, vec2 u, vec2 v);

/**
 * \brief Multiply a vector by a scalar.
 * \param dest Result vector.
 * \param u Vector.
 * \param k Scalar.
 */
void vec2_mult(vec2 dest, vec2 u, float k);

#endif
